/*
Geoffrey Wallace	
Title: International Law, (Non)Compliance, and Domestic Audience Costs


HYPOTHESES

Stated-Hyp1: Reneging on a "legalized" commitment versus an informal commitment will lead to higher audience costs. (page 1 of proposal)

	*Test-Hyp1: The more formalized a commitment is, the higher the audience cost of reneging. Case: No commitment vs. formal treaty. 

	*Test-Hyp2: The more formalized a commitment is, the higher the audience cost of reneging. Case: Verbal commitment vs. formal treaty. 
	
	*Test-Hyp3: The more formalized a commitment is, the higher the audience cost of reneging. Case: Soft-law commitment vs. formal treaty. 
	
	*Test-Hyp4: The more formalized a commitment is, the higher the audience cost of reneging. Case: verbal vs. soft-law. 
	
	
********************************************************************************	
* NOTE: 
It seems from the proposal that the author will be looking at the effect of both 
reneging a commitment to stay out or reneging a commitment to attack. In the 
survey, there are only treatments about formality of commitments regarding 
attack (no legal commitment condition about staying out). 

*/

clear all
use "WallaceS9.dta", clear

********************************************************************************

* CONSTRUCT INDICATORS OF EXPERIMENTAL MANIPULATIONS

	* Commitment type
	/* in control condition, there is no commitment to use force.
	In the treatment conditions, the president commits to use force
	*/
		tab P_OBLIGE
		destring P_OBLIGE, gen(commitment_type)
		lab def oblige 1 "no commitment" 2 "verbal commitment" 3 "soft law commitment" 4 "formal treaty commitment"
		lab val commitment_type oblige
		tab commitment_type
	
	* Force used
		tab P_FORCE
		destring P_FORCE, gen(force)
		recode force (1=1) (2=0)
		lab def force 0 "No use of force" 1 "Use of force"
		lab val force force
		tab force
		
	* Did the president renege?
	/* in control condition, you renege if you use force.
	In all three treatment conditions, you renege if you don't use force
	*/
		gen renege = . 
		replace renege=0 if commitment_type==1 & force==0
		replace renege=0 if commitment_type==2 & force==1
		replace renege=0 if commitment_type==3 & force==1
		replace renege=0 if commitment_type==4 & force==1
		replace renege=1 if commitment_type==1 & force==1
		replace renege=1 if commitment_type==2 & force==0
		replace renege=1 if commitment_type==3 & force==0
		replace renege=1 if commitment_type==4 & force==0		
		lab def renege 0 "Kept commitment" 1 "Reneged"
		lab val renege renege
		tab renege
		
* CONSTRUCT OUTCOME MEASURES

	* approval of president 
	tab Q10 
		// variable is reverse coded; recode so higher vals represent more approval
	recode Q10 (7=1) (6=2) (5=3) (4=4) (3=5) (2=6) (1=7) (*=.), gen(approval)
	lab def approve 1 "strongly disapprove" 7 "strongly approve"
	lab val approval approve
	tab approval, mis
	
	/* not including credibility as outcome because seems like the author intended 
	credibility to be a mediator (proposal p. 7). However, there is no hypothesis about
	mediation so we're not testing it.
	*/
	
********************************************************************************

* ANALYSIS
	
	*Test-Hyp1: The more formalized a commitment is, the higher the audience cost of reneging. Case: No commitment vs. formal treaty. 
	
	reg approval i.commitment_type##i.renege if commitment_type==1|commitment_type==4
		// do not reject. 0.000	
	tess 4.commitment_type#1.renege -, init(WallaceS9)
	
	*Test-Hyp2: The more formalized a commitment is, the higher the audience cost of reneging. Case: Verbal commitment vs. formal treaty. 

	reg approval i.commitment_type##i.renege if commitment_type==2|commitment_type==4
		// do not reject. 0.020 		
	tess 4.commitment_type#1.renege -
	
	*Test-Hyp3: The more formalized a commitment is, the higher the audience cost of reneging. Case: Soft-law commitment vs. formal treaty. 

	reg approval i.commitment_type##i.renege if commitment_type==3|commitment_type==4
		// reject. 0.149	
	tess 4.commitment_type#1.renege -
	
	*Test-Hyp4: The more formalized a commitment is, the higher the audience cost of reneging. Case: verbal vs. soft-law. 
	
	reg approval i.commitment_type##i.renege if commitment_type==2|commitment_type==3
		// reject. 0.368	
	tess 3.commitment_type#1.renege -	
